#ifndef VISIBLEBUTTON_H
#define VISIBLEBUTTON_H
#include <QPushButton>
#include <QMouseEvent>

class VisibleButton:public QPushButton//继承于QPushButton
{

    Q_OBJECT
public:
    VisibleButton(QWidget *parent=nullptr);
    ~VisibleButton();

    enum ButtonState{
        Selected,//鼠标选中状态
        UNSelected,//鼠标未选中状态
    };

    //
    virtual void enterEvent(QEvent *ev) override;//选中事件
    virtual void leaveEvent(QEvent *ev) override;//离开事件
signals:

private:
    ButtonState state_;//用于存储状态
};

#endif // VISIBLEBUTTON_H

